package com.jubaopen.dao.ibatis;

import com.jubaopen.bean.SmsRecord;
import com.jubaopen.dao.SmsRecordDAO;

public class SmsRecordDAOImpl extends BaseIBatisDao implements SmsRecordDAO {

	public int add(SmsRecord entry) {
		return (Integer) this.getSqlMapClientTemplate().insert(
				"SmsRecordMapper.insert", entry);
	}

	public int updateById(SmsRecord entry) {
		return this.getSqlMapClientTemplate().update(
				"SmsRecordMapper.updateById", entry);
	}

	public int updateBySeqNo(SmsRecord entry) {
		return this.getSqlMapClientTemplate().update(
				"SmsRecordMapper.updateBySeqNo", entry);
	}

	public SmsRecord getSmsCode(String mobile) {
		return (SmsRecord) this.getSqlMapClientTemplate().queryForObject(
				"SmsRecordMapper.getSmsCode", mobile);
	}

	public SmsRecord getOneById(int id) {
		return (SmsRecord) this.getSqlMapClientTemplate().queryForObject(
				"SmsRecordMapper.getById", id);
	}

	public SmsRecord getOneBySeqNo(String seqNo) {
		return (SmsRecord) this.getSqlMapClientTemplate().queryForObject(
				"SmsRecordMapper.getOneBySeqNo", seqNo);
	}

	@Override
	public SmsRecord getOneByReqId(String reqId) {
		return (SmsRecord) this.getSqlMapClientTemplate().queryForObject(
				"SmsRecordMapper.getOneBySeqNo", reqId);
	}
}
